package com.zw;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
public class Rev {

    @RabbitListener(queues = {MQ_Config.QUEUE_INFORM_EMAIL})
    public void recvEmail(String msg , Message message , Channel channel) throws IOException {
        System.out.println("Email信息：" + msg);
        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
    }

    @RabbitListener(queues = {MQ_Config.QUEUE_INFORM_SMS})
    public void recvSMS(String msg , Message message , Channel channel) throws IOException {
        System.out.println("SMS信息：" + msg);
        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
    }


}